package com.zara.store.server;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Transient;

import com.zara.store.common.ProductVO;


@Entity
@DiscriminatorValue("Accessory")
public class Accessory extends Product {

	private String category;
	private String measures;
	private String material;

	@Column
	public String getCategory(){
		return category;
	}

	public void setCategory(String newVal){
		category = newVal;
	}

	@Column
	public String getMeasures(){
		return measures;
	}

	public void setMeasures(String newVal){
		measures = newVal;
	}

	@Column
	public String getMaterial(){
		return material;
	}

	public void setMaterial(String newVal){
		material = newVal;
	}
	
	public Accessory() {
		// hib;
	}

	public Accessory(ProductVO productVO) {
		super(productVO);
		productVO.setType("Accessory");
		category = productVO.getCategory();
		measures = productVO.getMeasures();
		material = productVO.getMaterial();
	}
	
	@Override
	@Transient
	public ProductVO toVO() {
		ProductVO productVO = super.toVO();
		productVO.setCategory(category);
		productVO.setMeasures(measures);
		productVO.setMaterial(material);
		return productVO;
	}

}